import axios from 'axios';
import request from '@/utils/request.js';

export function getMessage(receiverUserId) {
  return request({
    url: '/matter/getMessage',
    method: 'get',
    params: {
      receiverUserId
    }
  });
}

export function addRecord(formData){
  return request({
    url: '/matter/addRecord',
    method: 'post',
    data: formData,
  })
}

export function updateStatus(messageId,status){
  return request({
    url: '/matter/update',
    method: 'PATCH',
    params: {
      messageId, 
      status
    }
  })
}

export function getDetail(messageId){
  return request({
    url: '/matter/detail',
    method: 'get',
     params: { 
      messageId: messageId 
    }
  })
}

export function getFileContent(messageId) {
  return request({
    url: '/matter/file', 
    method: 'get',
    params: {
      messageId: messageId
    },
    responseType: 'blob' 
  });
}